home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / lang / ada / gnat-3.05- / gnat-3 / gnat-3.05-i486-linux-elf-bin / examples / screen.adb < prev    next >
Encoding:
Text File  |  1996-06-11  |  960 b   |  40 lines

  1. --::::::::::
  2. --screen.adb
  3. --::::::::::
  4. with Text_IO;
  5. package body Screen is
  6.  
  7.   -- simple ANSI terminal emulator
  8.   -- Michael Feldman, The George Washington University
  9.   -- July, 1995
  10.  
  11.   -- These procedures will work correctly only if the actual
  12.   -- terminal is ANSI compatible. ANSI.SYS on a DOS machine
  13.   -- will suffice.
  14.  
  15.   package Int_IO is new Text_IO.Integer_IO (Num => Integer);
  16.  
  17.   procedure Beep is
  18.   begin
  19.     Text_IO.Put (Item => ASCII.BEL);
  20.   end Beep;
  21.  
  22.   procedure ClearScreen is
  23.   begin
  24.     Text_IO.Put (Item => ASCII.ESC);
  25.     Text_IO.Put (Item => "[2J");
  26.   end ClearScreen;
  27.  
  28.   procedure MoveCursor (To: in Position) is
  29.   begin                                                
  30.     Text_IO.New_Line;
  31.     Text_IO.Put (Item => ASCII.ESC);
  32.     Text_IO.Put ("[");
  33.     Int_IO.Put (Item => To.Row, Width => 1);
  34.     Text_IO.Put (Item => ';');
  35.     Int_IO.Put (Item => To.Column, Width => 1);
  36.     Text_IO.Put (Item => 'f');
  37.   end MoveCursor;  
  38.  
  39. end Screen;
  40.